home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / xpccomponents.idl < prev    next >
Text File  |  2006-05-08  |  7KB  |  205 lines

  1. /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is Mozilla Communicator client code, released
  17.  * March 31, 1998.
  18.  *
  19.  * The Initial Developer of the Original Code is
  20.  * Netscape Communications Corporation.
  21.  * Portions created by the Initial Developer are Copyright (C) 1998
  22.  * the Initial Developer. All Rights Reserved.
  23.  *
  24.  * Contributor(s):
  25.  *   John Bandhauer <jband@netscape.com> (original author)
  26.  *
  27.  * Alternatively, the contents of this file may be used under the terms of
  28.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  29.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  30.  * in which case the provisions of the GPL or the LGPL are applicable instead
  31.  * of those above. If you wish to allow use of your version of this file only
  32.  * under the terms of either the GPL or the LGPL, and not to allow others to
  33.  * use your version of this file under the terms of the MPL, indicate your
  34.  * decision by deleting the provisions above and replace them with the notice
  35.  * and other provisions required by the GPL or the LGPL. If you do not delete
  36.  * the provisions above, a recipient may use your version of this file under
  37.  * the terms of any one of the MPL, the GPL or the LGPL.
  38.  *
  39.  * ***** END LICENSE BLOCK ***** */
  40.  
  41. #include "nsISupports.idl"
  42. #include "xpcexception.idl"
  43. #include "xpcjsid.idl"
  44. #include "nsIComponentManager.idl"
  45. #include "nsIScriptableInterfaces.idl"
  46.  
  47. /**
  48. * interface of Components.classes
  49. * (interesting stuff only reflected into JavaScript)
  50. */
  51. [scriptable, uuid(978ff520-d26c-11d2-9842-006008962422)]
  52. interface nsIXPCComponents_Classes : nsISupports
  53. {
  54. };
  55.  
  56. /**
  57. * interface of Components.classesByID
  58. * (interesting stuff only reflected into JavaScript)
  59. */
  60. [scriptable, uuid(336a9590-4d19-11d3-9893-006008962422)]
  61. interface nsIXPCComponents_ClassesByID : nsISupports
  62. {
  63. };
  64.  
  65. /**
  66. * interface of Components.results
  67. * (interesting stuff only reflected into JavaScript)
  68. */
  69. [scriptable, uuid(2fc229a0-5860-11d3-9899-006008962422)]
  70. interface nsIXPCComponents_Results : nsISupports
  71. {
  72. };
  73.  
  74. /**
  75. * interface of Components.ID
  76. * (interesting stuff only reflected into JavaScript)
  77. */
  78. [scriptable, uuid(7994a6e0-e028-11d3-8f5d-0010a4e73d9a)]
  79. interface nsIXPCComponents_ID : nsISupports
  80. {
  81. };
  82.  
  83. /**
  84. * interface of Components.Exception
  85. * (interesting stuff only reflected into JavaScript)
  86. */
  87. [scriptable, uuid(5bf039c0-e028-11d3-8f5d-0010a4e73d9a)]
  88. interface nsIXPCComponents_Exception : nsISupports
  89. {
  90. };
  91.  
  92. /**
  93. * interface of Components.Constructor
  94. * (interesting stuff only reflected into JavaScript)
  95. */
  96. [scriptable, uuid(88655640-e028-11d3-8f5d-0010a4e73d9a)]
  97. interface nsIXPCComponents_Constructor : nsISupports
  98. {
  99. };
  100.  
  101. /**
  102. * interface of object returned by Components.Constructor
  103. * (additional interesting stuff only reflected into JavaScript)
  104. */
  105. [scriptable, uuid(c814ca20-e0dc-11d3-8f5f-0010a4e73d9a)]
  106. interface nsIXPCConstructor : nsISupports
  107. {
  108.     readonly attribute nsIJSCID classID;
  109.     readonly attribute nsIJSIID interfaceID;
  110.     readonly attribute string   initializer;
  111. };
  112.  
  113. /**
  114. * interface of object returned by Components.utils.Sandbox.
  115. */
  116. [scriptable, uuid(4f8ae0dc-d266-4a32-875b-6a9de71a8ce9)]
  117. interface nsIXPCComponents_utils_Sandbox : nsISupports
  118. {
  119. };
  120.  
  121. /**
  122. * interface of Components.utils
  123. */
  124. [scriptable, uuid(bcd54a63-34d9-468c-9a55-0fb5d2d8c677)]
  125. interface nsIXPCComponents_Utils : nsISupports
  126. {
  127.  
  128.     /* reportError is designed to be called from JavaScript only.
  129.      *
  130.      * It will report a JS Error object to the JS console, and return. It
  131.      * is meant for use in exception handler blocks which want to "eat"
  132.      * an exception, but still want to report it to the console.
  133.      *
  134.      * It must be called with one param, usually an object which was caught by
  135.      * an exception handler.  If it is not a JS error object, the parameter
  136.      * is converted to a string and reported as a new error.
  137.      */
  138.     void reportError();
  139.  
  140.     /* lookupMethod is designed to be called from JavaScript only.
  141.      *
  142.      * It returns a method looking only at the idl interfaces and
  143.      * ignores any overrides or resolvers that might be in place for
  144.      * a given scriptable wrapped native.
  145.      * It must be called with two params: an object and a method name.
  146.      * It returns a function object or throws an exception on error.
  147.      * This method exists only to solve mozilla browser problems
  148.      * when chrome attempts to lookup and call methods in content
  149.      * and *must* not get confused by method properties that have been
  150.      * replaced in the content JS code. This method is not recommended for
  151.      * any other use.
  152.      */
  153.     void lookupMethod();
  154.  
  155.     readonly attribute nsIXPCComponents_utils_Sandbox Sandbox;
  156.  
  157.     /*
  158.      * evalInSandbox is only meant to be called from JavaScript.
  159.      *
  160.      * evalInSandbox evaluates the provided source string in the given sandbox.
  161.      * It returns the result of the evaluation to the caller.
  162.      *
  163.      * var s = new C.u.Sandbox("http://www.mozilla.org");
  164.      * var res = C.u.evalInSandbox("var five = 5; 2 + five", s);
  165.      * var outerFive = s.five;
  166.      * s.seven = res;
  167.      * var thirtyFive = C.u.evalInSandbox("five * seven", s);
  168.      */
  169.     void evalInSandbox(in AString source/*, obj */);
  170. };
  171.  
  172. /**
  173. * interface of JavaScript's 'Components' object
  174. */
  175. [scriptable, uuid(155809f1-71f1-47c5-be97-d812ba560405)]
  176. interface nsIXPCComponents : nsISupports
  177. {
  178.     readonly attribute nsIScriptableInterfaces      interfaces;
  179.     readonly attribute nsIScriptableInterfacesByID  interfacesByID;
  180.     readonly attribute nsIXPCComponents_Classes     classes;
  181.     readonly attribute nsIXPCComponents_ClassesByID classesByID;
  182.     readonly attribute nsIStackFrame                stack;
  183.     readonly attribute nsIXPCComponents_Results     results;
  184.     readonly attribute nsIComponentManager          manager;
  185.     readonly attribute nsIXPCComponents_Utils       utils;
  186.  
  187.     readonly attribute nsIXPCComponents_ID          ID;
  188.     readonly attribute nsIXPCComponents_Exception   Exception;
  189.     readonly attribute nsIXPCComponents_Constructor Constructor;
  190.  
  191.     boolean isSuccessCode(in nsresult result);
  192.  
  193.     /* DEPRECATED: use Components.utils.lookupMethod instead.
  194.      * (But are you sure you really want this method any more?
  195.      *  See http://developer-test.mozilla.org/en/docs/XPCNativeWrapper )
  196.      */
  197.     void lookupMethod();
  198.  
  199.     /* DEPRECATED: use Components.utils.reportError instead. */
  200.     void reportError();
  201.  
  202.     /* 'lastResult' is accessable via JavaScript only */
  203.     /* 'returnCode' is accessable via JavaScript only */
  204. };
  205.